function createMedicsContractWindow()
	-- Medics contract window
	wndMedicsContract = guiCreateWindow(0.3469,0.2862,0.2914,0.35,"Contract Details: Paramedic",true)
	guiSetAlpha(wndMedicsContract,0.80000001192093)
	guiWindowSetSizable(wndMedicsContract,false)
	txtMedicsContractDetails = guiCreateMemo(15,31,343,174,"Being a paramedic can be a hard job, you will see people hurt and die, and sometimes even little children without legs. But if you like that, being a paramedic can be very satisfying. Save the world, or at least laugh in the face of it. Join the local hospital!",false,wndMedicsContract)
	guiSetAlpha(txtMedicsContractDetails,1)
	guiMemoSetReadOnly(txtMedicsContractDetails,true)
	txtMedicsContractDetails = guiCreateLabel(15,209,343,16,"Be warned: Screw up, and you WILL get fired!",false,wndMedicsContract)
	guiSetAlpha(txtMedicsContractDetails,1)
	guiLabelSetColor(txtMedicsContractDetails,255,255,255)
	guiLabelSetVerticalAlign(txtMedicsContractDetails,"top")
	guiLabelSetHorizontalAlign(txtMedicsContractDetails,"center",false)
	btnMedicsContractAccept = guiCreateButton(15,233,167,33,"Accept Job",false,wndMedicsContract)
	guiSetAlpha(btnMedicsContractAccept,1)
	btnMedicsContractReject = guiCreateButton(211,233,147,33,"Reject Job",false,wndMedicsContract)
	guiSetAlpha(btnMedicsContractReject,1)
	
	guiSetVisible(wndMedicsContract, false)
	
	addEventHandler("onClientGUIClick", btnMedicsContractReject, clientMedicsContractReject, false)
	addEventHandler("onClientGUIClick", btnMedicsContractAccept, clientMedicsContractAccept, false)
end

-- Create the marker and blip for the job
medicMarker = createMarker (2032.439, -1416.5625, 16.992 - 1, "cylinder", 1.2, 0, 0, 255, 255, getRootElement())
medicBlip = createBlip (2032.439, -1416.5625, 16.992 - 1, 22, 2, 255, 0, 0, 255, 0, 500)

function showMedicsContract(hitPlayer, matchingDimension)
	if getElementType (hitPlayer) == "player" and hitPlayer == getLocalPlayer() then
		if (source == medicMarker) then
			createMedicsContractWindow()
			if (wndMedicsContract ~= nil) then
				guiSetVisible (wndMedicsContract, true)
			else
				outputChatBox ("The contract window could not be loaded. Contact an admin please.")
			end
			showCursor (true)
			guiSetInputEnabled (true)
		end
	end
end

function clientMedicsContractAccept(button, state)
	if button == "left" and state == "up" then
		triggerServerEvent("acceptMedic", getLocalPlayer())
		guiSetInputEnabled(false)
		guiSetVisible(wndMedicsContract, false)
		showCursor(false)
	end
end

function clientMedicsContractReject(button, state)
	if button == "left" and state == "up" then
		outputChatBox("You rejected the job.")
		guiSetInputEnabled(false)
		guiSetVisible(wndMedicsContract, false)
		showCursor(false)
	end
end

addEventHandler("onClientMarkerHit", medicMarker, showMedicsContract)